New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SIGINFO prints thread backtraces #1320
Conversation
@nateberkopec For comparison to other gems. The sidekiq gem uses the TTIN signal to print threads' backtraces. |
@olleolleolle Unfortunately we already use TTIN to increase worker count :( |
Is the use-case this awesome:
(This is a super-neat feature.) |
(Also, could you rebase this on top of current master? The build is green on master.) |
Maybe I can do both SIGINFO and a pumactl command. On prod/Linux you can use the pumactl command, on dev you can just ctrl-t or SIGINFO. |
I just wanted to mention that this PR helped me a lot with finding an infinite loop in the middle of a request, thanks! |
@harmdewit Did you just use it as-is? Haven't looked at this in years but if it "just works" there's no reason not to merge. |
Yes, I copied and pasted the changes to my locally bundled gem and then did a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I'm OK with shipping this w/o fanout from parent to child but I really need to write a test. |
53b0b8f
to
f6397ce
Compare
test/test_puma_server.rb
Outdated
@@ -952,4 +947,11 @@ def test_request_body_wait_chunked | |||
|
|||
assert request_body_wait >= 1000 | |||
end | |||
|
|||
def test_siginfo_prints_thread_traces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to fix this test name as this particular test has nothing to do with the signal
f6397ce
to
6d76e8d
Compare
Needs some polish/cleanup and then an issue for future feature ideas (fanout from master, pumactl command). |
6d76e8d
to
124c76c
Compare
2ec447b
to
b03f20d
Compare
Super basic server test Add tests for single/cluster Cleanup
b03f20d
to
95d02e4
Compare
puma#1320 added support for using SIGINFO, but this is only available on BSD-based systems. SIGPROF is on Linux.
puma#1320 added support for using SIGINFO, but this is only available on BSD-based systems. SIGPROF is on Linux. This is useful for debugging infinite loops or slow performance.
puma#1320 added support for using SIGINFO, but this is only available on BSD-based systems. SIGPROF is on Linux. This is useful for debugging infinite loops or slow performance.
puma#1320 added support for using SIGINFO, but this is only available on BSD-based systems. SIGPROF is on Linux. This is useful for debugging infinite loops or slow performance.
puma#1320 added support for using SIGINFO, but this is only available on BSD-based systems. SIGWINCH is on Linux. This is useful for debugging infinite loops or slow performance.
#1320 added support for using SIGINFO, but this is only available on BSD-based systems. SIGWINCH is on Linux. This is useful for debugging infinite loops or slow performance.
FYI: This is really cool, but missing from |
@fschwahn good catch, want to contribute a PR adding it to the docs? |
Added in puma#1320
This was added in puma#1320 but was missing from documentation.
The feature was added in #1320 but was missing from documentation.
The feature was added in puma#1320 but was missing from documentation.
Closes #1041
I'm open to suggestions for other signals. SIGINFO is only present on *BSD.
Todo: